Fixed up functions a bit.