Few bug fixes + prepping for socket.io