More bugfixing and masking