Finish fixed problem

Fixed minor problems and revived some memory issue problem (clear used
memory). Adjust colour thought terminalr seem not working for now.