Fundamental tests + fixes