Fixed some minor buggs