Fixed master bugs. Master is currently working. Created slave mock.