Fix dimensions and add tests