Bug fixing

minor bugs