Basic bugs fixed