fixed last deploy errors and added more unit tests