Fix ArrayList self-assignment
Fix ArrayQueue memory access out of bounds

Detected by Valgrind. Now fixed.
Automate compilation