Fixed some errors

Fixed some errors by mtheall request,