Fixes #16 by applying the workaround for inner classes recursively.