Added backwards compatibility code to support #1277