Additional checks & code cleanup.