Improve test coverage; fix allna bug