Fix pointer error and remove useless mask