Fixed small bugs with major impact