Ugly implementation of issue #27