Fixed minor buggs