Added bounds checking

Also added 'tags' target to Makefile