Fixes #2744

Initial version, awaiting for review (: