Bug fixed, code cleaned