1) Check against instanceAgent != null. It could be null.
2) Its ok to assume that getMachine() is never null.