Added null pointer checks, ability to return RemoteObject