tried to fix #71 by generating the mode from the return type. can anyone confirm that this fixes the issue?