Small fixes and additional tests