fix for #349 mixed types

changed return type to int