Fixed some minor issues, all ready for implementing client