More error check cleanup, minor spacing edits