Fixed #504; progress on #502