Fix bugs and add in default values as per the stockmaster table