Improve handling of special cases, and improve sample layout