Additions for #1185 by @sam_dark