Fixed bug in type guessing