Small fixes for bugs