fixing an issue with using the wrong types

was causing issues with type inference because of lazy programming.