Fixed up the code a bit.