Added color output and fixed some bugs.