#240 Fixed one bug; improved coding style