bug fixes and cleanup 10-14-2013