Fixed up errors, seems to work well.