fixes/cleanup and updated tests