Fixed and cleaned up a bit.