Can build as an mgem, added correct sign casts