SMController cleaned. other minor bugs fixed