Minor stability and bug fixes