Bug fixes for 1-9-2013 bugs and code cleanup