Master bug fixes