Fixed a few issues which exposed in exercises.