stratum implementation and bug fixes