Added header, fixed missing cast