Misc. Bug Fixes

Fixed some bugs and changed RPC structure