BugFix nullpointer on Casts and style