fixed a bunch of errors from ghost