fix some bugs and clean the code
Merge HEAD, branch 'master' of https://github.com/gateway4labs/labmanager