Fix typecasting and after_create callback