Code clean up. Various undefined variables / notices.