I found my issue. I implemented formatWriteContinue and it got rid of my program error. I'm curious as to why I even need to implement this one as it is never referenced when writing the file - the layer functions take precedence. Anyhow, the reason why the layerformat example wasn't working is the photoshop file I was trying to save from is reporting the wrong number of planes for some reason. I tried a different file and it works perfectly.