fixed a typo and casting issues