Fixed some syntax issues and slicing issue in case of NaN filling.