mistyping fixes, code core cleanup