cleaning up some obvious issues - still not tested (will do that when I'll get back home ;))