fixed warnings and some bugs

still some warnings to go...