Fix #30 and improve overall type guessing if the type is already correct