Fixed key check
Fixed compile