Found the real main source of bugs in the casting mechanism