Add decoder checks

Also some fixes.