Misc snippets and utils (.NET)