Code snippets, fixes tests