Fixed major bug in getId(). Not sure why it doesn't work but oh well.