Clean up

Cleaned up code for previous bug fix.