Fixed some bugs with bulk handling and more. Unit tests now pass