Fixed some formatting and a cast.