Fixed some small bugs