bug fixing in semt and minor cleanup
minor cleanup