Improved phone comms and error messages

Also fixed a few bugs and cleaned up code