Bbdd integrity

Solved the BBDD integrity problem encountered when deleting apps. This did not happen when deleting dummy apps since they did not have AppVar tables associated.