Fixed broadcasting bugs

Fixed bugs related to Numpy broadcasting. Under some environments,
broadcasting might not be working well. Instead, we exploit Numpy array
slicing.