Task #590 - Fixed some bugs and improvements.