fixes for bugs and stuff