Kracoeus 7718

this PR fixes several bugs and an improper import statement.
+1  and we probably will see other issues from this in the future too if we do not fix.