Cleaned up code. Fixed bug before it will happen.