Fixes #76 (bad generic type checking)