Fixed misleading diagnostic message - fixes #507