Resolves #136, corrects type check